package com.longcai.piaojia.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/6.
 */
@HttpInlet(Conn.INDEX_SIGN_SET)
public class SignInSubmitGet extends BaseAsyGet<List<String>> {

    public String user_id;

    public SignInSubmitGet(AsyCallBack<List<String>> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected List<String> parser(JSONObject object) throws Exception {

        TOAST = object.optString("message");

        if(object.optInt("code")==200){

            List<String> data = new ArrayList<>();

            JSONArray jsonArray = object.optJSONArray("data");

            for(int i=0;i<jsonArray.length();i++){

                data.add(jsonArray.optString(i));

            }

            return data;

        }

        return null;
    }
}
